home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 1 / Macwelt DVD 1.toast / Software für Mac-OS X / Entwickler-Tools / netbeans / modules / ext / djava.jar / koala / dynamicjava / interpreter / InterpreterException.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-03-14  |  2.1 KB  |  53 lines

  1. package koala.dynamicjava.interpreter;
  2.  
  3. import koala.dynamicjava.interpreter.error.CatchedExceptionError;
  4. import koala.dynamicjava.interpreter.error.ExecutionError;
  5. import koala.dynamicjava.interpreter.throwable.ThrownException;
  6. import koala.dynamicjava.parser.wrapper.ParseError;
  7. import koala.dynamicjava.tree.Node;
  8.  
  9. public class InterpreterException extends Exception {
  10.    protected SourceInformation sourceInformation;
  11.    protected String message;
  12.  
  13.    public SourceInformation getSourceInformation() {
  14.       return this.sourceInformation;
  15.    }
  16.  
  17.    public String getMessage() {
  18.       return this.message;
  19.    }
  20.  
  21.    public InterpreterException(ParseError var1) {
  22.       if (var1.getLine() != -1) {
  23.          this.sourceInformation = new SourceInformation(var1.getFilename(), var1.getLine(), var1.getColumn());
  24.          this.message = "L" + var1.getLine() + ", C" + var1.getColumn() + " (" + var1.getFilename() + "):\n" + var1.getMessage();
  25.       } else {
  26.          this.message = var1.getMessage();
  27.       }
  28.  
  29.    }
  30.  
  31.    public InterpreterException(ExecutionError var1) {
  32.       Node var2 = var1.getNode();
  33.       if (var2 != null && var2.getFilename() != null) {
  34.          this.sourceInformation = new SourceInformation(var2.getFilename(), var2.getBeginLine(), var2.getBeginColumn());
  35.          this.message = "L" + var2.getBeginLine() + ", C" + var2.getBeginColumn() + " (" + var2.getFilename() + "):\n";
  36.       } else {
  37.          this.message = "";
  38.       }
  39.  
  40.       if (var1 instanceof CatchedExceptionError) {
  41.          String var10001 = this.message;
  42.          this.message = var10001 + ((CatchedExceptionError)var1).getException();
  43.       } else if (var1 instanceof ThrownException) {
  44.          String var3 = this.message;
  45.          this.message = var3 + ((ThrownException)var1).getException();
  46.       } else {
  47.          String var4 = this.message;
  48.          this.message = var4 + var1.getMessage();
  49.       }
  50.  
  51.    }
  52. }
  53.